<template>
  <div id="private-index">
    <private-head></private-head>
    <private-collection :collections_img="Collections_img"></private-collection>
  </div>
</template>

<script>
import PrivateHead from './components/PrivateHead'
import PrivateCollection from './components/PrivateCollection'
import axios from "axios"
export default {
  name: 'PrivateIndex',
  components:{
    PrivateHead,
    PrivateCollection
  },
  data() {
    return {
      Collections_img:[],
      userName: sessionStorage.userName,
    }
  },
  methods:{
    getCollectionsURL(){
      axios.get('api/collection/'+this.userName).then(res => {
        res = res.data;
        console.log(res)
        if (res.data) {
          const data = res.data;
          this.Collections_img = data;
        }
      })
    }
  },
  mounted(){
    this.getCollectionsURL();
  }
}
</script>

<style scoped>

</style>
